package org.stvd.entities.common;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import org.springframework.format.annotation.DateTimeFormat;
import org.stvd.core.annotation.serializer.DateTimeSerializer;
import org.stvd.entities.base.BaseEntity;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

/**
 * 附件信息-实体类
 * @author houzx
 */
@Entity
@Table(name="affix_upload")
public class AffixUpload extends BaseEntity{

    private static final long serialVersionUID = 7688314355043807475L;
    
    @Id
    @Column(name = "id", nullable = false)
    @JsonDeserialize(using = LongJsonDeserializer.class)
    @JsonSerialize(using = LongJsonSerializer.class)
    private Long id = null;
    
    /**
     * 本地存储路径
     */
    @Column(name = "local_url")
    private String localUrl="";
    
    /**
     * 远程存储路径
     */
    @Column(name = "remote_url")
    private String remote_url="";
    
    /**
     * 附件扩展名
     */
    @Column(name = "extension")
    private String extension="";
    
    /**
     * 附件大小
     */
    @Column(name = "size")
    private Long size = null;
    
    
    /**
     * 附件名称
     */
    @Column(name = "name")
    private String name="";
    
    /**
     * 状态{0：临时文件；1：正式文件}
     */
    @Column(name = "status", nullable = false)
    private String status="";
    
    /**
     * 创建人ID
     */
    @Column(name = "create_user", nullable = false)
    private String createUser="";
    
    /**
     * 创建时间
     */
    @Column(name = "create_time", nullable = false)
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = DateTimeSerializer.class)
    private Date createTime = null;
    
    /**
     * 修改时间
     */
    @Column(name = "modify_time", nullable = false)
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = DateTimeSerializer.class)
    private Date modifyTime = null;
    
    /**
     * 备注信息
     */
    @Column(name = "remark")
    private String remark="";
    
    /**
     * 排序号
     */
    @Column(name = "order_no")
    private Integer orderNo = null;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getLocalUrl() {
        return localUrl;
    }

    public void setLocalUrl(String localUrl) {
        this.localUrl = localUrl;
    }

    public String getRemote_url() {
        return remote_url;
    }

    public void setRemote_url(String remote_url) {
        this.remote_url = remote_url;
    }

    public String getExtension() {
        return extension;
    }

    public void setExtension(String extension) {
        this.extension = extension;
    }

    public Long getSize() {
        return size;
    }

    public void setSize(Long size) {
        this.size = size;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(Integer orderNo) {
        this.orderNo = orderNo;
    }
}
